const seq = require('sequelize')
const time = require('../time')

module.exports = {
  NAME: 'sys_user',
  TABLE: {
    user_id: {
      type: seq.INTEGER(11),
      primaryKey: true,
      unique: true,
      autoIncrement: true,
      comment: 'user_id 主键，自增',
      field: 'user_id', //  相应的字段名称
    },
    socket_id: {
      type: seq.STRING(64),
      comment: 'socket_id',
      field: 'socket_id', //  相应的字段名称
    },
    realname: {
      type: seq.STRING(64),
      comment: '真实姓名',
      field: 'realname',
    },
    username: {
      type: seq.STRING(64),
      comment: '用户名',
      field: 'username', //  相应的字段名称
    },
    password: {
      type: seq.STRING(255),
      comment: '密码',
      field: 'password',
    },
    phone: {
      type: seq.STRING(20),
      comment: '手机号',
      field: 'phone',
    },
    remark: {
      type: seq.TEXT,
      comment: '备注',
      field: 'remark',
    },
    status:{
      type: seq.INTEGER(1),
      defaultValue: 0,
      comment: '是否在线,0-离线，1-在线',
      field: 'status'
    },
    sex:{
      type: seq.INTEGER(1),
      defaultValue: 0,
      comment: '性别,0-男生，1-女生',
      field: 'sex'
    },
    avatar:{
      type: seq.STRING(225),
      comment: '头像',
      field: 'avatar',
    },
    login_time:{
      type: seq.BIGINT(30),
      comment: '最后登录时间',
      field: 'login_time'
    },
    ...time.create_date,
    ...time.update_date,
    ...time.delete_date,
    ...time.create_by,
    ...time.update_by,
    ...time.delete_by,
  },
}
